/**
 * @desc
 *
 * @使用场景
 *
 * @author  杨晓东[of1081]
 * @company qianmi.com
 * @Date    16/12/9
 **/
'use strict';

//删除阿里云上对应的文件 ;;
var loadUpdateService =require('../service/load-update-service');
let {ossClient} = loadUpdateService;
let co = require('co');

let files2Del = [
   // '/x-site/prod/public/barRepo/x-site-ui/widget-bar/foot-bar/single-demo3/foot-single-demo3-ul.css',
   // '/x-site/prod/public/barRepo/x-site-ui/widget-bar/site-bar/demo1/site-demo1-ul.css',
   // '/x-site/prod/public/barRepo/x-site-ui/widget-bar/foot-bar/demo1/foot-demo1-ul.css',

  // '/x-site/prod/public/barRepo/x-site-ui/widget-bar/site-bar/demo-d2p-goods/site-demo-ul.css',
  // '/x-site/prod/public/barRepo/x-site-ui/widget-bar/search-bar/demo-d2p-login/search-demo-nav-ul.css',
  // '/x-site/prod/public/barRepo/x-site-ui/widget-bar/search-bar/demo-d2p-goods/search-demo-nav-ul.css',
  // '/x-site/prod/public/barRepo/x-site-ui/widget-bar/foot-bar/demo-d2p-login/foot-demo-ul.css',
  // '/x-site/prod/public/barRepo/x-site-ui/widget-bar/foot-bar/demo-d2p-goods/foot-demo-ul.css',
  //   '/x-site/prod/public/barRepo/x-site-ui/widget-bar/floor-bar/single-demo2/floor2-single-demo2-slide.css',
  //   '/x-site/prod/public/barRepo/x-site-ui/widget-bar/floor-bar/single-demo2/floor2-single-demo2-tab.css',
  //   '/x-site/prod/public/barRepo/x-site-ui/widget-bar/foot-bar/demo2/foot-demo2-ul.css',
  //   '/x-site/prod/public/barRepo/x-site-ui/widget-bar/foot-bar/mi/mi-foot-ul.css',
  //   '/x-site/prod/public/barRepo/x-site-ui/widget-bar/site-bar/demo1/site-demo1-new-ul.css',
  //   '/x-site/prod/public/barRepo/x-site-ui/widget-bar/search-bar/demo2/search-demo2-ul.css',
  // '/x-site/gray/public/barRepo/x-site-ui/widget-bar/search-bar/demo2/search-demo2-ul.css',
    '/x-site/prod/public/barRepo/x-site-ui-zhang/widget-bar/search-bar/demo2/search-demo2-nav-ul.css',
];

// async function getTrace (){
 //  for(let i =0,ilen=files2Del.length ; i<ilen; i++){
 //  let response   = await

// co((function*(){
//   let response = yield ossClient.delMultiObjectAbsolute(files2Del);
//   console.log(response);
// })());

  // }
// }
//
// getTrace().then(()=>{
//
// });

co((function * () {
    // let response = yield ossClient.getObjectAbsolute('/x-site/test/public/template-index/pc-template-index.json');
    // let templates = JSON.parse(response.content.toString());
    // for (let i=0; i<templates.length; i++) {
    //     if(templates[i].id == '1dc34af8-d905-11e5-9d37-db8f51a37763') {
    //         templates.splice(i, 1);
    //     }
    // }
    // console.log(templates);
    yield ossClient.putObjectAbsolute('./aaa.js', '/store/jquery.datatable.js');
})())
